package zy1208.zy4;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;

public class demo {
    public static void main(String[] args) throws Exception {
        Class<?> aClass = Class.forName("zy1208.zy4.Student");
        Constructor<?> c = aClass.getConstructor(String.class,int.class);
        Object o = c.newInstance("张三",25);
        Method s = aClass.getDeclaredMethod("show");
        Object o1 = s.invoke(o);
        System.out.println(o1);
    }
}
